<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<script type="text/javascript" src="./jqueryui/js/jquery-1.4.4.min.js"></script>
<script type="text/javascript">

function addnewline(){
	var html="";
	html+="<tr>";
	html+="<td>";
	html+="key";
	html+="<input class='key'>";
	html+="</td>";
	html+="<td>";
	html+="value";
	html+="<input class='value'>";
	html+="</td>";
	html+="</tr>";
	$("#testtable").append(html);
}
function delline(){
	$("#testtable tr:last").remove();
}
function sendrequest(){
	var content="";
	$("#testtable tr").each(function(i){
		var firsttd=$(this).find("td:first");
		var keytxt=firsttd.find("input").val();
		if(keytxt.length<=0)
			return true;
		var nexttd=firsttd.next();
		var valuetxt=nexttd.find("input").val();
		if(valuetxt.length<=0)
			return true;
		if(i>0){
			content+="&";
		}
		content+=keytxt+"="+valuetxt;
	});
}
</script>
<body>
	<input id="urlinput">
	<button onclick="addnewline();">addline</button>
	<button onclick="delline();">delline</button>
	<button onclick="sendrequest();">sendrequest</button>
	<table width="800" id="testtable">
	</table>
</body>
</html>